
#[derive(Debug)]
pub enum RepoError {
    Undefined,
    InvalidArgument,
    AlreadyExist,
}


impl std::fmt::Display for RepoError {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            RepoError::Undefined => write!(f, "Undefined Error"),
            RepoError::InvalidArgument => write!(f, "Invalid Argument"),
            RepoError::AlreadyExist => write!(f, "Already Exist"),
        }
    }
}

impl std::error::Error for RepoError{}

//impl std::error::Error for RepoError {
//    fn source(&self) -> Option<&(dyn std::error::Error + "static")> {
//        match self {
//            RepoError::Undefined(err) => Some(err),
//            RepoError::InvalidArgument(err) => Some(err),
//        }
//    }
//}